package server

import (
	"simple_game/app/libs/logger"
	actor2 "simple_game/app/server/actor"
)

type rpcActor struct {
}

var RpcActor rpcActor

func (ra rpcActor) Rpc2Actor(pid int64, msg []byte) {
	actor, ok := actor2.Directors.ActorMap.Load(pid)
	if !ok {
		logger.ERROR("actor not found ,name:", pid)
		return
	}
	rpcActor := actor.(actor2.IActor)
	if player, ok := rpcActor.(Player); ok {
		player.PlayerSend2Mail(msg)
	}
}
